package cn.com.blueInfo.bpm.system.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.system.entity.Role;
import cn.com.blueInfo.bpm.system.request.RoleDTO;
import cn.com.blueInfo.bpm.system.response.RoleVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 角色表 对象转换
 * @author suxch
 * @since 2025-08-31 16:20:56
 */
@Mapper(componentModel = "spring")
public interface RoleConvert
        extends BaseConvert<Role, RoleDTO, RoleVO> {

    Role dtoToEntity(RoleDTO dto);

    Role dtoToEntity(RoleDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "roleType", target = "roleType", qualifiedByName = "enumToDesc")
    RoleVO entityToVO(Role entity);

}